#include "NodeVarForArray.h"

namespace Net
{

NodeVarForArray::NodeVarForArray():BaseNodeVar(NodeVarType_E::Array_E)
{

}

NodeVarForArray::~NodeVarForArray()
{

}

uint32_t NodeVarForArray::getVarSize() const
{
    uint32_t sum(0);
    for (auto &ptr : vecData)
    {
        sum += ptr->getVarSize();
    }

    return sum;
}

std::vector<std::size_t> NodeVarForArray::getDim() const
{
    std::vector<std::size_t> dims;
    dims.push_back(vecData.size());
    for (auto &ptr : vecData)
    {
        auto data = ptr->getDim();
        std::copy(data.begin(), data.end(), std::back_insert_iterator(dims));
    }

    return dims;
}
    
}